<?php 
//引进配置信息
include '../include/init.php';
//引入数据库配置信息
include '../include/mysql.config.php';
//引入公共函数
include '../include/common.fun.php';
islogin();
if($_GET){
	$id=isset($_GET['id'])?$_GET['id']+0:0;
	$sql="SELECT * from wd_page where page_id=$id";
	$about=$db->getOne($sql);
}



if ($_POST){
	$title=$_POST['title'];
	$author=$_POST['author'];
	$content=$_POST['content'];
	$id=$_POST['id'];
	
	$date=array(
			'page_title' => $title,
			'page_addtime' => time(),
			'page_content' => $content,
			'page_author' => $author
		);
	
	$where = 'page_id='.$id;
	$res = $db->update('wd_page',$date,$where);
	if($res){
		alert('更新成功','about_list.php');
	}else{
		alert('更新失败');
	}
}


include 'view/about_edit.php';